home *** CD-ROM | disk | FTP | other *** search
- function addPopUp(x, y, text, col, ydif, alpha)
- {
- temp = this.attachMovie("Popup","PopUp" + pu,pu);
- temp._x = x;
- temp._y = y;
- temp.gfx.text = text;
- temp._alpha = alpha;
- if(col != 32)
- {
- temp.gfx.gotoAndStop(col);
- }
- if(temp._x - temp._width / 2 < - superg.destx + 20)
- {
- temp._x = - superg.destx + 20 + temp._width / 2;
- }
- if(temp._x + temp._width / 2 > - superg.destx + sw + 20)
- {
- temp._x = - superg.destx + sw + 20 - temp._width / 2;
- }
- if(temp._y - 50 < - superg.desty)
- {
- }
- pu++;
- }
- function fireFrame()
- {
- this.ticks = this.ticks + 1;
- if(this.work == 0)
- {
- if(this.ticks > this.timeoff)
- {
- this.ticks = 0;
- this.work = 1;
- this.gfx.play();
- }
- }
- else if(this.ticks > this.timeon)
- {
- this.ticks = 0;
- this.work = 0;
- this.gfx.play();
- }
- }
- function fireLand(override)
- {
- if(override == undefined)
- {
- override = 0;
- }
- if(override)
- {
- if(!fire)
- {
- return 0;
- }
- }
- if(this.work || override)
- {
- superg.gotoAndStop("burning");
- superg.yspeed = -10;
- superg.soundClip.gotoAndStop("fire");
- superg.xspeed = -3 + random(6);
- superg.die = 1;
- superg.dead = 1;
- superg.go = 1;
- superg.aim = 0;
- superg.flying = 1;
- return 1;
- }
- this.gfx.gotoAndStop(1);
- this.onEnterFrame = null;
- }
- function fireReset()
- {
- this.ticks = 0;
- this.work = 0;
- this.gfx.gotoAndStop(1);
- this.gotoAndStop(1);
- this.onEnterFrame = this.frame;
- }
- function crumbleReset()
- {
- this.gfx.gotoAndStop(1);
- this.gotoAndStop(1);
- this.timer = 0;
- this.crumble = 0;
- this.kill = 1;
- this.onEnterFrame = null;
- }
- function crumbleStanding()
- {
- this.timer = this.timer + 1;
- if(this.timer > this.time)
- {
- if(this.gfx._currentframe == 1)
- {
- this.gfx.play();
- }
- if(this.timer > this.time + this.crumbletime)
- {
- if(this.kill)
- {
- if(!this.crumble)
- {
- this.crumble = 1;
- superg.gotoAndStop("diefalling");
- superg.yspeed = 0;
- superg.xspeed = 0;
- superg.oldy = 50000;
- superg.die = 1;
- superg.dead = 1;
- superg.go = 1;
- superg.aim = 0;
- superg.flying = 1;
- superg.firstdie = 1;
- aimer._visible = 0;
- }
- }
- }
- }
- }
- function crumbleLaunch()
- {
- this.gfx.play();
- this.crumble = 1;
- this.kill = 0;
- }
- function movingFrame()
- {
- this.ticks = this.ticks + 1;
- if(this.ticks > this.movetime)
- {
- this.ticks = 0;
- this.dir = !this.dir;
- }
- if(this.dir)
- {
- this._x += this.xspeed;
- this._y += this.yspeed;
- }
- else
- {
- this._x -= this.xspeed;
- this._y -= this.yspeed;
- }
- }
- function movingLand(override)
- {
- this.onEnterFrame = null;
- }
- function movingReset()
- {
- this.onEnterFrame = this.frame;
- }
- function setUpPickups(clip)
- {
- clip.world = this;
- clip.p = 0;
- clip.pArray = new Array();
- clip.pickUp = doPickups;
- clip.unPickUp = removePickups;
- }
- function stationaryPickup()
- {
- if(this.hitTest(superg))
- {
- this.parent.pArray[this.pos][2] = 1;
- _parent.knuggs += snumber;
- addPopUp(this._x,this._y,"flower: +" + snumber,2);
- superg.soundClip.gotoAndPlay("powerup");
- this.removeMovieClip("");
- }
- }
- function movingPickup()
- {
- this.ticks = this.ticks + 1;
- this._x += this.xspeed;
- this._y += this.yspeed;
- if(this.xspeed < 0)
- {
- this.fire._xscale = -100;
- }
- if(this.ticks > this.time)
- {
- this._x = this.startx;
- this._y = this.starty;
- this.ticks = 0;
- }
- if(this.hit.hitTest(superg))
- {
- this.parent.pArray[this.pos][2] = 1;
- _parent.boost = Math.min(_parent.boost + 25,100);
- addPopUp(this._x,this._y,"extra fuel!",2);
- superg.soundClip.gotoAndPlay("booster");
- this.removeMovieClip("");
- }
- }
- function addPickup(clip, x, y, type, pass)
- {
- clip.pArray[clip.p] = new Array();
- clip.pArray[clip.p][0] = x;
- clip.pArray[clip.p][1] = y;
- clip.pArray[clip.p][2] = 0;
- clip.pArray[clip.p][3] = type;
- if(pass != undefined)
- {
- clip.pArray[clip.p][4] = pass;
- }
- clip.p = clip.p + 1;
- }
- function doPickups()
- {
- var i = 0;
- while(i < this.p)
- {
- if(!this.pArray[i][2])
- {
- if(this.pArray[i][4] != undefined)
- {
- if(this.pArray[i][3] == 2)
- {
- var temp = this.world.attachMovie("moveObject",this._name + "_pickup_" + i,piu++,this.pArray[i][4]);
- }
- else if(this.pArray[i][3] == 3)
- {
- var temp = this.world.attachMovie("killObject",this._name + "_pickup_" + i,piu++,this.pArray[i][4]);
- }
- else if(this.pArray[i][3] == 4)
- {
- var temp = this.world.attachMovie("electricObject",this._name + "_pickup_" + i,piu++,this.pArray[i][4]);
- }
- else
- {
- var temp = this.world.attachMovie("object",this._name + "_pickup_" + i,piu++,this.pArray[i][4]);
- }
- }
- else if(this.pArray[i][3] == 3)
- {
- var temp = this.world.attachMovie("killObject",this._name + "_pickup_" + i,piu++);
- }
- else
- {
- var temp = this.world.attachMovie("object",this._name + "_pickup_" + i,piu++);
- }
- temp._x = this.pArray[i][0];
- temp._y = this.pArray[i][1];
- if(this.pArray[i][3] == 2)
- {
- temp.onEnterFrame = movingPickup;
- }
- else if(this.pArray[i][3] == 3)
- {
- temp.onEnterFrame = killingPickup;
- }
- else if(this.pArray[i][3] == 4)
- {
- temp.onEnterFrame = electricPickup;
- electricPickupSetup(temp);
- }
- else
- {
- temp.onEnterFrame = stationaryPickup;
- }
- temp.pos = i;
- temp.parent = this;
- }
- i++;
- }
- }
- function removePickups()
- {
- var i = 0;
- while(i < this.p)
- {
- this.world[this._name + "_pickup_" + i].removeMovieClip("");
- i++;
- }
- }
- w = 90;
- h = 25;
- sw = 510;
- sh = 400;
- startx = 0;
- starty = 400;
- p = 6000;
- piu = 4000;
- pu = 100000;
- mt = 0;
- snumber = 10;
- baseLives = 5;
- reset();
- temp = this.attachMovie("basePlatform","basePlatform" + mt,mt);
- temp._x = startx + w / 2;
- temp._y = starty;
- superg._x = temp._x;
- superg._y = temp._y - h;
- setUpPickups(temp);
- addPickup(temp,startx + 130,starty - 103,1);
- addPickup(temp,startx + 157,starty - 91,1);
- addPickup(temp,startx + 101,starty - 92,1);
- temp.pickUp();
- mt++;
- temp = this.attachMovie("basePlatform","basePlatform" + mt,mt);
- temp._x = startx + 175 + w / 2;
- temp._y = starty;
- startx = temp._x;
- starty = temp._y;
- setUpPickups(temp);
- addPickup(temp,startx + 297,starty - 53,1);
- addPickup(temp,startx + 284,starty - 75,1);
- addPickup(temp,startx + 268,starty - 99,1);
- mt++;
- temp = this.attachMovie("basePlatform","basePlatform" + mt,mt,pass);
- temp._visible = 0;
- temp._x = startx + 250 + w / 2;
- temp._y = starty;
- startx = temp._x;
- starty = temp._y;
- setUpPickups(temp);
- addPickup(temp,startx + 386,starty - 246,1);
- addPickup(temp,startx + 372,starty - 282,1);
- addPickup(temp,startx + 356,starty - 319,1);
- mt++;
- temp = this.attachMovie("basePlatform","basePlatform" + mt,mt);
- temp._x = startx + 375 + w / 2;
- temp._y = starty;
- temp._visible = 0;
- startx = temp._x;
- starty = temp._y;
- setUpPickups(temp);
- pass = {xspeed:5,yspeed:0,startx:startx - 75,starty:starty - 300,time:150};
- addPickup(temp,startx - 75,starty - 300,2,pass);
- mt++;
- temp = this.attachMovie("basePlatform","basePlatform" + mt,mt);
- temp._x = startx + 222 + w / 2;
- temp._y = starty - 79;
- temp._visible = 0;
- startx = temp._x;
- starty = temp._y;
- setUpPickups(temp);
- addPickup(temp,startx + 248,starty - 54,1);
- mt++;
- pass = {time:80,crumbletime:15,work:0};
- temp = this.attachMovie("basePlatformCrumble","basePlatform" + mt,mt,pass);
- temp.standing = crumbleStanding;
- temp.launch = crumbleLaunch;
- temp.reset = crumbleReset;
- temp.reset();
- temp._x = startx + 200 + w / 2;
- temp._y = starty;
- temp._visible = 0;
- startx = temp._x;
- starty = temp._y;
- setUpPickups(temp);
- addPickup(temp,startx + 415,starty - 145,1);
- addPickup(temp,startx + 415,starty - 175,1);
- mt++;
- temp = this.attachMovie("basePlatform","basePlatform" + mt,mt);
- temp._x = startx + 375 + w / 2;
- temp._y = starty - 79;
- temp._visible = 0;
- startx = temp._x;
- starty = temp._y;
- setUpPickups(temp);
- addPickup(temp,startx + 51,starty - 256,1);
- addPickup(temp,startx + 58,starty - 285,1);
- addPickup(temp,startx + 65,starty - 315,1);
- mt++;
- temp = this.attachMovie("basePlatform","basePlatform" + mt,mt);
- temp._x = startx + 302 + w / 2;
- temp._y = starty - 209;
- temp._visible = 0;
- startx = temp._x;
- starty = temp._y;
- mt++;
- temp = this.attachMovie("basePlatform","basePlatform" + mt,mt);
- temp._x = startx + 116 + w / 2;
- temp._y = starty - 194;
- temp._visible = 0;
- startx = temp._x;
- starty = temp._y;
- setUpPickups(temp);
- addPickup(temp,temp._x + 248,temp._y - 49,1);
- mt++;
- temp = this.attachMovie("basePlatform","basePlatform" + mt,mt);
- temp._x = startx + 195 + w / 2;
- temp._y = starty;
- temp._visible = 0;
- temp.parent = 1;
- temp.inter = 1;
- setUpPickups(temp);
- addPickup(temp,temp._x + 1,temp._y - 216,1);
- addPickup(temp,temp._x + 1,temp._y - 236,1);
- addPickup(temp,temp._x + 1,temp._y - 256,1);
- mt++;
- temp = this.attachMovie("basePlatform","basePlatform" + mt,mt);
- temp._x = startx + 198 + w / 2;
- temp._y = starty - 175;
- temp._visible = 0;
- temp.inter = 1;
- setUpPickups(temp);
- addPickup(temp,startx + 422,starty - 53,1);
- mt++;
- temp = this.attachMovie("basePlatform","basePlatform" + mt,mt);
- temp._x = startx + 375 + w / 2;
- temp._y = starty;
- temp._visible = 0;
- startx = temp._x;
- starty = temp._y;
- mt++;
- temp = this.attachMovie("basePlatform","basePlatform" + mt,mt);
- temp._x = startx + 375 + w / 2;
- temp._y = starty;
- temp._visible = 0;
- temp.parent = 1;
- temp.inter = 1;
- setUpPickups(temp);
- addPickup(temp,startx + 51,starty - 231,1);
- addPickup(temp,startx + 61,starty - 260,1);
- addPickup(temp,startx + 72,starty - 290,1);
- mt++;
- pass = {time:80,crumbletime:15,work:0};
- temp = this.attachMovie("basePlatformCrumble","basePlatform" + mt,mt,pass);
- temp.standing = crumbleStanding;
- temp.launch = crumbleLaunch;
- temp.reset = crumbleReset;
- temp.reset();
- temp._x = startx + w / 2;
- temp._y = starty - 172;
- temp._visible = 0;
- temp.inter = 1;
- mt++;
- temp = this.attachMovie("basePlatform","basePlatform" + mt,mt);
- temp._x = startx + 4 + w / 2;
- temp._y = starty;
- temp._visible = 0;
- startx = temp._x;
- starty = temp._y;
- mt++;
- pass = {time:80,crumbletime:15,work:0};
- temp = this.attachMovie("basePlatformCrumble","basePlatform" + mt,mt,pass);
- temp.standing = crumbleStanding;
- temp.launch = crumbleLaunch;
- temp.reset = crumbleReset;
- temp.reset();
- temp._x = startx + 377 + w / 2;
- temp._y = starty - 9;
- temp._visible = 0;
- temp.parent = 1;
- temp.inter = 1;
- mt++;
- pass = {time:80,crumbletime:15,work:0};
- temp = this.attachMovie("basePlatformCrumble","basePlatform" + mt,mt,pass);
- temp.standing = crumbleStanding;
- temp.launch = crumbleLaunch;
- temp.reset = crumbleReset;
- temp.reset();
- temp._x = startx + 188 + w / 2;
- temp._y = starty - 186;
- temp._visible = 0;
- startx = temp._x;
- starty = temp._y;
- setUpPickups(temp);
- pass = {xspeed:5,yspeed:0,startx:startx - 75,starty:starty - 150,time:150};
- addPickup(temp,startx - 75,starty - 150,2,pass);
- mt++;
- temp = this.attachMovie("basePlatform","basePlatform" + mt,mt);
- temp._x = startx + 378 + w / 2;
- temp._y = starty - 278;
- temp._visible = 0;
- startx = temp._x;
- starty = temp._y;
- setUpPickups(temp);
- addPickup(temp,startx + 321,starty - 57,1);
- addPickup(temp,startx + 315,starty - 90,1);
- addPickup(temp,startx + 306,starty - 123,1);
- addPickup(temp,startx + 255,starty - 323,1);
- addPickup(temp,startx + 249,starty - 347,1);
- mt++;
- pass = {timeoff:50,timeon:25,work:0};
- temp = this.attachMovie("basePlatformFire","basePlatform" + mt,mt,pass);
- temp.frame = fireFrame;
- temp.land = fireLand;
- temp.reset = fireReset;
- temp._visible = 0;
- temp._x = startx + 275 + w / 2;
- temp._y = starty;
- startx = temp._x;
- starty = temp._y;
- mt++;
- pass = {time:80,crumbletime:15,work:0};
- temp = this.attachMovie("basePlatformCrumble","basePlatform" + mt,mt,pass);
- temp.standing = crumbleStanding;
- temp.launch = crumbleLaunch;
- temp.reset = crumbleReset;
- temp.reset();
- temp._x = startx + 355 + w / 2;
- temp._y = starty - 99;
- temp._visible = 0;
- temp.parent = 1;
- temp.inter = 1;
- mt++;
- pass = {timeoff:50,timeon:25,work:0};
- temp = this.attachMovie("basePlatformFire","basePlatform" + mt,mt,pass);
- temp.frame = fireFrame;
- temp.land = fireLand;
- temp.reset = fireReset;
- temp._visible = 0;
- temp._x = startx + 44 + w / 2;
- temp._y = starty - 260;
- temp._visible = 0;
- startx = temp._x;
- starty = temp._y;
- mt++;
- pass = {time:80,crumbletime:15,work:0};
- temp = this.attachMovie("basePlatformCrumble","basePlatform" + mt,mt,pass);
- temp.standing = crumbleStanding;
- temp.launch = crumbleLaunch;
- temp.reset = crumbleReset;
- temp.reset();
- temp._x = startx + 375 + w / 2;
- temp._y = starty - 9;
- temp._visible = 0;
- temp.parent = 1;
- temp.inter = 1;
- mt++;
- pass = {time:80,crumbletime:15,work:0};
- temp = this.attachMovie("basePlatformCrumble","basePlatform" + mt,mt,pass);
- temp.standing = crumbleStanding;
- temp.launch = crumbleLaunch;
- temp.reset = crumbleReset;
- temp.reset();
- temp._x = startx + 193 + w / 2;
- temp._y = starty - 172;
- temp._visible = 0;
- temp.inter = 1;
- mt++;
- pass = {time:80,crumbletime:15,work:0};
- temp = this.attachMovie("basePlatformCrumble","basePlatform" + mt,mt,pass);
- temp.standing = crumbleStanding;
- temp.launch = crumbleLaunch;
- temp.reset = crumbleReset;
- temp.reset();
- temp._x = startx + 5 + w / 2;
- temp._y = starty - 5;
- temp._visible = 0;
- temp.inter = 1;
- setUpPickups(temp);
- addPickup(temp,startx + 252,starty - 207,1);
- addPickup(temp,startx + 248,starty - 240,1);
- addPickup(temp,startx + 242,starty - 279,1);
- mt++;
- pass = {timeoff:50,timeon:25,work:0};
- temp = this.attachMovie("basePlatformFire","basePlatform" + mt,mt,pass);
- temp.frame = fireFrame;
- temp.land = fireLand;
- temp.reset = fireReset;
- temp._visible = 0;
- temp._x = startx + 192 + w / 2;
- temp._y = starty - 151;
- temp._visible = 0;
- startx = temp._x;
- starty = temp._y;
- setUpPickups(temp);
- addPickup(temp,startx + 433,starty - 209,1);
- addPickup(temp,startx + 452,starty - 241,1);
- addPickup(temp,startx + 470,starty - 274,1);
- addPickup(temp,startx + 453,starty - 311,1);
- addPickup(temp,startx + 432,starty - 343,1);
- mt++;
- temp = this.attachMovie("wormhole","wormhole",mt);
- temp._visible = 0;
- temp._x = startx + 375 + w / 2;
- temp._y = starty - 150;
- temp.standing = function()
- {
- _parent.gotoAndPlay("endgame");
- };
- superg.maxtargets = mt;
-